Carbon


FlushEvents

Header: Events.h Carbon status: Supported

Removes low-level events from the Operating System event queue.

void FlushEvents (
    EventMask whichMask, 
    EventMask stopMask
);
whichMask

A value that indicates which kinds of low-level events are to be removed from the Operating System event queue; this parameter is interpreted as a sum of event mask constants. You specify the event mask using one or more of the values defined by “EventMask Constant”. The whichMask and stopMask parameters together specify which events to remove.

stopMask

A value that limits which low-level events are to be removed from the Operating System event queue; this parameter is interpreted as a sum of event mask constants. You specify the event mask using one or more of the values defined by “EventMask Constant”. FlushEvents does not remove any low-level events that are specified by the stopMask parameter. To remove all events specified by the whichMask parameter, specify 0 as the stopMask parameter.

DISCUSSION

FlushEvents removes only low-level events stored in the Operating System event queue; it does not remove activate, update, operating-system, or high-level events. FlushEvents does not remove any types of events not stored in the Operating System event queue.

You can choose to use the FlushEvents function when your application first starts to empty the Operating System event queue of any keystrokes or mouse events generated by the user while the Finder loaded your application. In general, however, your application should not empty the queue at any other time as this loses user actions and makes your application and the computer appear unresponsive to the user.

You specify which low-level events to remove using the whichMask and stopMask parameters. FlushEvents removes the low-level events specified by the whichMask parameter, up to but not including the first event of any type specified by the stopMask parameter.

If the event queue doesn’t contain any of the events specified by the whichMask parameter, FlushEvents does not remove any events from the queue.

AVAILABILITY

Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)